package com.example.controller;

import com.example.service.HazelcastService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/***
 *
 * 测试生成分布式id
 */
@RestController
public class TestFlakeController {

    public static final String Flake = "Flake_Flake_Flake";

    @Resource
    private HazelcastService hazelcastService;

    @RequestMapping("getFlakeId")
    public long getFlakeId() {
        return hazelcastService.getFlakeId(Flake);
    }
}
